package com.hypo.controller;

import com.hypo.pojo.JobOption;
import com.hypo.pojo.Result;
import com.hypo.pojo.StudentOption;
import com.hypo.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/report")
public class ReportController {
    @Autowired
    private ReportService reportService;

    /**
     * 职位统计
     */
    @GetMapping("/empJobData")
    public Result getEmpJobData() {
        JobOption jobOption = reportService.getEmpJobData();
        return Result.success(jobOption);
    }

    /**
     * 性别统计
     */
    @GetMapping("/empGenderData")
    public Result empGenderData() {
        List<Map> list = reportService.empGenderData();
        return Result.success(list);
    }

    /**
     * 学历统计
     */
    @GetMapping("/studentDegreeData")
    public Result studentDegreeData() {
        List<Map> list = reportService.studentDegreeData();
        return Result.success(list);
    }

    /**
     * 班级人数统计
     */
    @GetMapping("/studentCountData")
    public Result studentCountData() {
        StudentOption studentOption = reportService.studentCountData();
        return Result.success(studentOption);
    }

}
